package com.situ.ymall.service.impl;

import com.situ.ymall.entity.Goods;
import com.situ.ymall.mapper.GoodsMapper;
import com.situ.ymall.service.GoodsService;
import com.situ.ymall.service.GoodsSortService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class GoodsServiceImp implements GoodsService {
    @Autowired
    private GoodsMapper goodsMapper;
    @Override
    public List search(Goods goods,Integer firstSortId) {
        goods.setStatus(0);
        return goodsMapper.select(goods,firstSortId);
    }

    @Override
    public Goods getById(Integer id) {

        return goodsMapper.selectByPrimaryKey(id);
    }
}
